package com.sixfoot.domain;

import com.sixfoot.foundation.persistence.UUIDBaseModel;

import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "permission")
public class Permission extends UUIDBaseModel {
	private String name;
	private String code;
	private String description;
	private Resource resource;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToOne(mappedBy = "permission")
	public Resource getResource() {
		return resource;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}

	public String toString () {
		return this.getDescription();
	}

}
